/**
 * Copyright(c)2017 wuhan PeaceMap Co.,Ltd.
 * All right reserved. 
 */
package com.adds.lvds.security.acegi.session;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.session.SessionRegistryImpl;

/**
 * @description 
 * @author zhangjian
 * @date 2017-5-18
 */
public class PmcSessionRegistryImpl extends SessionRegistryImpl {

	public synchronized void registerNewSession(String sessionId,
	        Object principal) {
		if(!(principal instanceof PmcPrincipal)){
			principal = new PmcPrincipal(SecurityContextHolder.getContext().getAuthentication());
		}
		super.registerNewSession(sessionId, principal);
	}
	
	
}
